<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>WPF DependencyProperty</Title>
      <Shortcut>dp</Shortcut>
      <Author>Antonio Tse</Author>
      <Description>WPF:依赖属性片段</Description>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>propertyType</ID>
          <ToolTip>你的property类型</ToolTip>
          <Default>int</Default>
        </Literal>
        <Literal>
          <ID>propertyName</ID>
          <ToolTip>你的property名称</ToolTip>
          <Default>Property</Default>
        </Literal>
        <Literal>
          <ID>ownerType</ID>
          <ToolTip>拥有此属性的类名称</ToolTip>
          <Default>OwnerClass</Default>
        </Literal>
        <Literal>
          <ID>defaultValue</ID>
          <ToolTip>默认值</ToolTip>
          <Default>0</Default>
        </Literal>
      </Declarations>
      <Code Language="CSharp"><![CDATA[public $propertyType$ $propertyName$ {
            get { return ($propertyType$)GetValue($propertyName$Property); }
            set { SetValue($propertyName$Property, value); }
        }
        public static readonly DependencyProperty $propertyName$Property =
            DependencyProperty.Register("$propertyName$", typeof($propertyType$), typeof($ownerType$),
                new FrameworkPropertyMetadata($defaultValue$, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>